<?php
/**
 * Created by PhpStorm.
 * User: xutao
 * Date: 2018/8/7
 * Time: 10:00
 */
namespace app\common\model;
use think\Model;

class TrModel extends Model{
    protected $table = 'think_travel_records';
    protected $autoWriteTimestamp = 'datetime';
    //获取当地图片id
    public function getImgAttr($value){
        if($value){
            $re = ImgModel::all($value);
            return $re;
        }else{
            return [];
        }
    }
    //是否为当地节日 获取器
    public function getIsFestivalAttr($value){
        $data = [
            1=>'是',
            0=>'否'
        ];
        return $data[$value];
    }
}